package com.apes.fn.fico.invoiceApply.repository;

import com.apes.fn.fico.invoiceApply.model.InvoiceApplyItem;
import com.apes.framework.jpa.repository.CustomRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @BelongsProject: apes-server
 * @BelongsPackage: com.apes.fn.fico.invoiceApply.repository
 * @ClassName: InvoiceApplyItemRepository
 * @Author: pyb
 * @Description: 发票申请明细持久层
 * @CreateTime: 2021-04-08 18:02
 * @Version: 1.0
 */
public interface InvoiceApplyItemRepository extends CustomRepository<InvoiceApplyItem, String> {
    /**
     * fetch data by company id
     *
     * @param companyId company id
     * @param invoiceCategory invoiceCategory id
     * @param statementId statement id
     * @return List<InvoiceApplyItem>
     */
    @Query("select T from InvoiceApplyItem  T where T.invoiceApply.company.id =?1 and T.invoiceApply.invoiceCategory.id=?2 and T.statementId=?3 ")
    List<InvoiceApplyItem> findByCompanyAndInvoiceCategoryAndStatementId(String companyId,String invoiceCategory,String statementId);
}
